package ccrClasses.layer2;

import java.util.ArrayList;
import java.util.List;

import ccrClasses.ICcr;

public class Units implements ICcr {
	
	public final static String OPEN_TAG = "<Units>";

	public final static String CLOSE_TAG = "</Units>";
	
	private List<Unit> units;
	
	public Units(List<Unit> unit) {
		super();
		this.setUnit(unit);
	}
	
	public Units() {
		super();
		units = new ArrayList<Unit>();
	}

	@Override
	public String constructCcrString() {
		String ccrUnits = OPEN_TAG;
		for(Unit u: units){
			ccrUnits = ccrUnits + u.constructCcrString();
		}
		ccrUnits = ccrUnits + CLOSE_TAG;
		return ccrUnits;
	}

	/**
	 * @param unit the unit to set
	 */
	public void setUnit(List<Unit> units) {
		this.units = units;
	}

	/**
	 * @return the unit
	 */
	public List<Unit> getUnit() {
		return units;
	}

}
